package com.odaqiang.testsn.domain;

public class Sn extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 类型
     */
    public enum Type {
        /**
         * 入库
         */
        STORAGE(1, "STOR"),
        /**
         * APP 编号
         */
        APP(2, "APP"),;

        Type(Integer code, String KeyName) {
            this.code = code;
            this.keyName = KeyName;
        }

        private Integer code;
        private String keyName;

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getKeyName() {
            return keyName;
        }

        public void setKeyName(String keyName) {
            this.keyName = keyName;
        }

        public Type getByCode(Integer code) {
            for (Type type : Type.values()) {
                if (type.getCode().intValue() == code.intValue()) {
                    return type;
                }
            }
            return null;
        }
    }

    private Long snId;
    private Long lastValue;
    private Integer type;
    private Long version;

    public Long getSnId() {
        return snId;
    }

    public void setSnId(Long snId) {
        this.snId = snId;
    }

    public Long getLastValue() {
        return lastValue;
    }

    public void setLastValue(Long lastValue) {
        this.lastValue = lastValue;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }
}
